home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Tools / Mac F2C 1.3.3 / Test Project ƒ / test.c (C Output) < prev    next >
Text File  |  1996-06-24  |  18KB  |  584 lines

  1. /* test.f -- translated by f2c (version 19941113).
  2.    You must link the resulting object file with the libraries:
  3.     -lf2c -lm   (in that order)
  4. */
  5.  
  6. #include "f2c.h"
  7.  
  8. /* Table of constant values */
  9.  
  10. static integer c__9 = 9;
  11. static integer c__1 = 1;
  12. static integer c__10 = 10;
  13. static integer c__3 = 3;
  14. static integer c__4 = 4;
  15. static integer c__5 = 5;
  16. static doublereal c_b152 = .33333333333333331;
  17.  
  18. /* Main program */ MAIN__(void)
  19. {
  20.     /* Format strings */
  21.     static char fmt_99[] = "(a1)";
  22.  
  23.     /* Builtin functions */
  24.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  25.         e_wsle(void), s_rsfe(cilist *), do_fio(integer *, char *, ftnlen),
  26.          e_rsfe(void);
  27.     /* Subroutine */ int s_stop(char *, ftnlen);
  28.  
  29.     /* Local variables */
  30.     static char junk[2];
  31.     extern /* Subroutine */ int alg_test__(integer *), i_o_test__(void), 
  32.         flt_test__(integer *), int_test__(integer *), trn_test__(void);
  33.  
  34.     /* Fortran I/O blocks */
  35.     static cilist io___1 = { 0, 6, 0, 0, 0 };
  36.     static cilist io___2 = { 0, 6, 0, 0, 0 };
  37.     static cilist io___3 = { 0, 5, 0, fmt_99, 0 };
  38.     static cilist io___5 = { 0, 6, 0, 0, 0 };
  39.     static cilist io___6 = { 0, 6, 0, 0, 0 };
  40.     static cilist io___7 = { 0, 5, 0, fmt_99, 0 };
  41.     static cilist io___8 = { 0, 6, 0, 0, 0 };
  42.     static cilist io___9 = { 0, 6, 0, 0, 0 };
  43.     static cilist io___10 = { 0, 5, 0, fmt_99, 0 };
  44.     static cilist io___11 = { 0, 6, 0, 0, 0 };
  45.     static cilist io___12 = { 0, 6, 0, 0, 0 };
  46.     static cilist io___13 = { 0, 5, 0, fmt_99, 0 };
  47.     static cilist io___14 = { 0, 6, 0, 0, 0 };
  48.     static cilist io___15 = { 0, 6, 0, 0, 0 };
  49.     static cilist io___16 = { 0, 5, 0, fmt_99, 0 };
  50.     static cilist io___17 = { 0, 6, 0, 0, 0 };
  51.  
  52.  
  53. /*     This is a FORTRAN program to test Mac F2C v1.1 */
  54.     s_wsle(&io___1);
  55.     do_lio(&c__9, &c__1, "*****   Input/Output Test   *****", 33L);
  56.     e_wsle();
  57.     i_o_test__();
  58.     s_wsle(&io___2);
  59.     do_lio(&c__9, &c__1, "\n*****   End of I/O test, hit return to continue."
  60.         "..", 51L);
  61.     e_wsle();
  62.     s_rsfe(&io___3);
  63.     do_fio(&c__1, junk, 2L);
  64.     e_rsfe();
  65.     s_wsle(&io___5);
  66.     do_lio(&c__9, &c__1, "\n*****   Integer Math Test   *****", 34L);
  67.     e_wsle();
  68.     int_test__(&c__10);
  69.     s_wsle(&io___6);
  70.     do_lio(&c__9, &c__1, "\n*****   End of integer math test, hit return to "
  71.         "continue...", 60L);
  72.     e_wsle();
  73.     s_rsfe(&io___7);
  74.     do_fio(&c__1, junk, 2L);
  75.     e_rsfe();
  76.     s_wsle(&io___8);
  77.     do_lio(&c__9, &c__1, "\n*****   Floating Point Math Test   *****", 41L);
  78.     e_wsle();
  79.     flt_test__(&c__10);
  80.     s_wsle(&io___9);
  81.     do_lio(&c__9, &c__1, "\n*****   End of floating point math test, hit ret"
  82.         "urn to continue...", 67L);
  83.     e_wsle();
  84.     s_rsfe(&io___10);
  85.     do_fio(&c__1, junk, 2L);
  86.     e_rsfe();
  87.     s_wsle(&io___11);
  88.     do_lio(&c__9, &c__1, "\n*****   Algebraic Function Test   *****", 40L);
  89.     e_wsle();
  90.     alg_test__(&c__10);
  91.     s_wsle(&io___12);
  92.     do_lio(&c__9, &c__1, "\n*****   End of algebraic function test, hit retu"
  93.         "rn to continue...", 66L);
  94.     e_wsle();
  95.     s_rsfe(&io___13);
  96.     do_fio(&c__1, junk, 2L);
  97.     e_rsfe();
  98.     s_wsle(&io___14);
  99.     do_lio(&c__9, &c__1, "\n*****   Transcendental Function Test   *****", 
  100.         45L);
  101.     e_wsle();
  102.     trn_test__();
  103.     s_wsle(&io___15);
  104.     do_lio(&c__9, &c__1, "\n*****   End of transcendental function test, hit"
  105.         " return to continue...", 71L);
  106.     e_wsle();
  107.     s_rsfe(&io___16);
  108.     do_fio(&c__1, junk, 2L);
  109.     e_rsfe();
  110.     s_wsle(&io___17);
  111.     do_lio(&c__9, &c__1, "\n*****   This completes all of the tests   *****", 
  112.         48L);
  113.     e_wsle();
  114.     s_stop("", 0L);
  115.     return 0;
  116. } /* MAIN__ */
  117.  
  118. /**************************************************************************/
  119.  
  120. /*     Subroutine to do the I/O tests */
  121.  
  122. /**************************************************************************/
  123. /* Subroutine */ int i_o_test__(void)
  124. {
  125.     /* Format strings */
  126.     static char fmt_312[] = "(1x,\002The number you entered was: \002,f13.6)";
  127.     static char fmt_313[] = "(1x,\002The number you entered was: \002,f17.10)"
  128.         ;
  129.     static char fmt_399[] = "(a1)";
  130.     static char fmt_304[] = "(5x,a20,5(i1,2x),5x,5(f4.2,2x))";
  131.  
  132.     /* System generated locals */
  133.     olist o__1;
  134.     cllist cl__1;
  135.  
  136.     /* Builtin functions */
  137.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  138.         e_wsle(void), s_rsle(cilist *), e_rsle(void), s_wsfe(cilist *), 
  139.         do_fio(integer *, char *, ftnlen), e_wsfe(void), s_rsfe(cilist *),
  140.          e_rsfe(void);
  141.     void s_copy(char *, char *, ftnlen, ftnlen);
  142.     integer f_open(olist *), s_wsue(cilist *), do_uio(integer *, char *, 
  143.         ftnlen), e_wsue(void), f_clos(cllist *), s_rsue(cilist *), e_rsue(
  144.         void);
  145.  
  146.     /* Local variables */
  147.     static char text[40];
  148.     static real a[5];
  149.     static integer i, j[5];
  150.     static real x;
  151.     static doublereal dx;
  152.  
  153.     /* Fortran I/O blocks */
  154.     static cilist io___18 = { 0, 6, 0, 0, 0 };
  155.     static cilist io___19 = { 0, 5, 0, 0, 0 };
  156.     static cilist io___21 = { 0, 6, 0, 0, 0 };
  157.     static cilist io___22 = { 0, 6, 0, 0, 0 };
  158.     static cilist io___23 = { 0, 5, 0, 0, 0 };
  159.     static cilist io___25 = { 0, 6, 0, fmt_312, 0 };
  160.     static cilist io___26 = { 0, 6, 0, 0, 0 };
  161.     static cilist io___27 = { 0, 5, 0, 0, 0 };
  162.     static cilist io___29 = { 0, 6, 0, fmt_313, 0 };
  163.     static cilist io___30 = { 0, 6, 0, 0, 0 };
  164.     static cilist io___31 = { 0, 5, 0, 0, 0 };
  165.     static cilist io___33 = { 0, 6, 0, 0, 0 };
  166.     static cilist io___34 = { 0, 6, 0, 0, 0 };
  167.     static cilist io___35 = { 0, 5, 0, fmt_399, 0 };
  168.     static cilist io___38 = { 0, 60, 0, 0, 0 };
  169.     static cilist io___39 = { 0, 6, 0, 0, 0 };
  170.     static cilist io___40 = { 0, 6, 0, fmt_304, 0 };
  171.     static cilist io___41 = { 0, 50, 0, 0, 0 };
  172.     static cilist io___42 = { 0, 6, 0, 0, 0 };
  173.     static cilist io___43 = { 0, 6, 0, fmt_304, 0 };
  174.  
  175.  
  176. /*     Screen I/O tests */
  177.     s_wsle(&io___18);
  178.     do_lio(&c__9, &c__1, "\nPart 1:  Screen I/O tests.\n\nEnter an integer v"
  179.         "alue.", 52L);
  180.     e_wsle();
  181.     s_rsle(&io___19);
  182.     do_lio(&c__3, &c__1, (char *)&i, (ftnlen)sizeof(integer));
  183.     e_rsle();
  184.     s_wsle(&io___21);
  185.     do_lio(&c__9, &c__1, "The number you entered was:", 27L);
  186.     do_lio(&c__3, &c__1, (char *)&i, (ftnlen)sizeof(integer));
  187.     e_wsle();
  188.     s_wsle(&io___22);
  189.     do_lio(&c__9, &c__1, "\nEnter a single precision floating point value...",
  190.          49L);
  191.     e_wsle();
  192.     s_rsle(&io___23);
  193.     do_lio(&c__4, &c__1, (char *)&x, (ftnlen)sizeof(real));
  194.     e_rsle();
  195.     s_wsfe(&io___25);
  196.     do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real));
  197.     e_wsfe();
  198.     s_wsle(&io___26);
  199.     do_lio(&c__9, &c__1, "\nEnter a double precision floating point value...",
  200.          49L);
  201.     e_wsle();
  202.     s_rsle(&io___27);
  203.     do_lio(&c__5, &c__1, (char *)&dx, (ftnlen)sizeof(doublereal));
  204.     e_rsle();
  205.     s_wsfe(&io___29);
  206.     do_fio(&c__1, (char *)&dx, (ftnlen)sizeof(doublereal));
  207.     e_wsfe();
  208.     s_wsle(&io___30);
  209.     do_lio(&c__9, &c__1, "\nEnter some text (40 char max)...", 33L);
  210.     e_wsle();
  211.     s_rsle(&io___31);
  212.     do_lio(&c__9, &c__1, text, 40L);
  213.     e_rsle();
  214.     s_wsle(&io___33);
  215.     do_lio(&c__9, &c__1, "The text you entered was: ", 26L);
  216.     do_lio(&c__9, &c__1, text, 40L);
  217.     e_wsle();
  218.     s_wsle(&io___34);
  219.     do_lio(&c__9, &c__1, "\nPart 2:  file I/O tests.  Hit return to continue"
  220.         "...", 52L);
  221.     e_wsle();
  222.     s_rsfe(&io___35);
  223.     do_fio(&c__1, text, 40L);
  224.     e_rsfe();
  225. /*     File I/O tests:  Store some values and write them to file */
  226.     for (i = 1; i <= 5; ++i) {
  227.     j[i - 1] = i;
  228.     a[i - 1] = (doublereal) i;
  229.     }
  230.     s_copy(text, "A test message.", 40L, 15L);
  231.     o__1.oerr = 0;
  232.     o__1.ounit = 60;
  233.     o__1.ofnmlen = 8;
  234.     o__1.ofnm = "test.dat";
  235.     o__1.orl = 0;
  236.     o__1.osta = 0;
  237.     o__1.oacc = 0;
  238.     o__1.ofm = "unformatted";
  239.     o__1.oblnk = 0;
  240.     f_open(&o__1);
  241.     s_wsue(&io___38);
  242.     do_uio(&c__1, text, 40L);
  243.     do_uio(&c__5, (char *)&j[0], (ftnlen)sizeof(integer));
  244.     do_uio(&c__5, (char *)&a[0], (ftnlen)sizeof(real));
  245.     e_wsue();
  246.     cl__1.cerr = 0;
  247.     cl__1.cunit = 60;
  248.     cl__1.csta = 0;
  249.     f_clos(&cl__1);
  250.     s_wsle(&io___39);
  251.     do_lio(&c__9, &c__1, "Wrote the following data to file test.dat:\n", 43L);
  252.     e_wsle();
  253.     s_wsfe(&io___40);
  254.     do_fio(&c__1, text, 40L);
  255.     for (i = 1; i <= 5; ++i) {
  256.     do_fio(&c__1, (char *)&j[i - 1], (ftnlen)sizeof(integer));
  257.     }
  258.     for (i = 1; i <= 5; ++i) {
  259.     do_fio(&c__1, (char *)&a[i - 1], (ftnlen)sizeof(real));
  260.     }
  261.     e_wsfe();
  262. /* Reset the variables and read them back */
  263.     for (i = 1; i <= 5; ++i) {
  264.     j[i - 1] = 99;
  265.     a[i - 1] = 99.f;
  266.     }
  267.     s_copy(text, "reset", 40L, 5L);
  268.     o__1.oerr = 0;
  269.     o__1.ounit = 50;
  270.     o__1.ofnmlen = 8;
  271.     o__1.ofnm = "test.dat";
  272.     o__1.orl = 0;
  273.     o__1.osta = 0;
  274.     o__1.oacc = 0;
  275.     o__1.ofm = "unformatted";
  276.     o__1.oblnk = 0;
  277.     f_open(&o__1);
  278.     s_rsue(&io___41);
  279.     do_uio(&c__1, text, 40L);
  280.     do_uio(&c__5, (char *)&j[0], (ftnlen)sizeof(integer));
  281.     do_uio(&c__5, (char *)&a[0], (ftnlen)sizeof(real));
  282.     e_rsue();
  283.     cl__1.cerr = 0;
  284.     cl__1.cunit = 50;
  285.     cl__1.csta = 0;
  286.     f_clos(&cl__1);
  287.     s_wsle(&io___42);
  288.     do_lio(&c__9, &c__1, "\nRead the following data from file test.dat:\n", 
  289.         45L);
  290.     e_wsle();
  291.     s_wsfe(&io___43);
  292.     do_fio(&c__1, text, 40L);
  293.     for (i = 1; i <= 5; ++i) {
  294.     do_fio(&c__1, (char *)&j[i - 1], (ftnlen)sizeof(integer));
  295.     }
  296.     for (i = 1; i <= 5; ++i) {
  297.     do_fio(&c__1, (char *)&a[i - 1], (ftnlen)sizeof(real));
  298.     }
  299.     e_wsfe();
  300.     return 0;
  301. } /* i_o_test__ */
  302.  
  303. /**************************************************************************/
  304.  
  305. /*     Subroutine to do the integer math tests */
  306.  
  307. /**************************************************************************/
  308. /* Subroutine */ int int_test__(integer *m)
  309. {
  310.     /* Format strings */
  311.     static char fmt_203[] = "(10x,\002n\002,5x,\002n^2\002,5x,\002n^3\002,"
  312.         "5x,\002n/2\002,3x,\002n^2/2\002,3x,\002n^3/2\002)";
  313.     static char fmt_202[] = "(5x,6(i6,2x))";
  314.  
  315.     /* System generated locals */
  316.     integer i__1, i__2, i__3, i__4;
  317.  
  318.     /* Builtin functions */
  319.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  320.         e_wsle(void), s_wsfe(cilist *), e_wsfe(void), do_fio(integer *, 
  321.         char *, ftnlen);
  322.  
  323.     /* Local variables */
  324.     static integer i, j, k;
  325.  
  326.     /* Fortran I/O blocks */
  327.     static cilist io___44 = { 0, 6, 0, 0, 0 };
  328.     static cilist io___45 = { 0, 6, 0, fmt_203, 0 };
  329.     static cilist io___49 = { 0, 6, 0, fmt_202, 0 };
  330.  
  331.  
  332.     s_wsle(&io___44);
  333.     do_lio(&c__9, &c__1, "\nGenerate a table of integers, squares, cubes, an"
  334.         "d their halves.\n", 65L);
  335.     e_wsle();
  336.     s_wsfe(&io___45);
  337.     e_wsfe();
  338.     i__1 = *m;
  339.     for (i = 1; i <= i__1; ++i) {
  340. /* Computing 2nd power */
  341.     i__2 = i;
  342.     j = i__2 * i__2;
  343. /* Computing 3rd power */
  344.     i__2 = i, i__3 = i__2;
  345.     k = i__3 * (i__2 * i__2);
  346.     s_wsfe(&io___49);
  347.     do_fio(&c__1, (char *)&i, (ftnlen)sizeof(integer));
  348.     do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
  349.     do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
  350.     i__2 = i / 2;
  351.     do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer));
  352.     i__3 = j / 2;
  353.     do_fio(&c__1, (char *)&i__3, (ftnlen)sizeof(integer));
  354.     i__4 = k / 2;
  355.     do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer));
  356.     e_wsfe();
  357.     }
  358.     return 0;
  359. } /* int_test__ */
  360.  
  361. /**************************************************************************/
  362.  
  363. /*     Subroutine to do the floating point math tests */
  364.  
  365. /**************************************************************************/
  366. /* Subroutine */ int flt_test__(integer *m)
  367. {
  368.     /* Format strings */
  369.     static char fmt_205[] = "(12x,\002x\002,6x,\002x^2\002,6x,\002x^3\002,"
  370.         "6x,\002x/2\002,4x,\002x^2/2\002,4x,\002x^3/2\002)";
  371.     static char fmt_201[] = "(5x,6(f8.2,1x))";
  372.  
  373.     /* System generated locals */
  374.     integer i__1;
  375.     real r__1, r__2, r__3;
  376.  
  377.     /* Builtin functions */
  378.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  379.         e_wsle(void), s_wsfe(cilist *), e_wsfe(void), do_fio(integer *, 
  380.         char *, ftnlen);
  381.  
  382.     /* Local variables */
  383.     static integer i;
  384.     static real x1, x2, x3;
  385.  
  386.     /* Fortran I/O blocks */
  387.     static cilist io___50 = { 0, 6, 0, 0, 0 };
  388.     static cilist io___51 = { 0, 6, 0, fmt_205, 0 };
  389.     static cilist io___56 = { 0, 6, 0, fmt_201, 0 };
  390.  
  391.  
  392.     s_wsle(&io___50);
  393.     do_lio(&c__9, &c__1, "\nGenerate a table of floats, their squares, cubes"
  394.         ", and their halves.\n", 69L);
  395.     e_wsle();
  396.     s_wsfe(&io___51);
  397.     e_wsfe();
  398.     i__1 = *m;
  399.     for (i = 1; i <= i__1; ++i) {
  400.     x1 = i * 1.f;
  401. /* Computing 2nd power */
  402.     r__1 = x1;
  403.     x2 = r__1 * r__1;
  404. /* Computing 3rd power */
  405.     r__1 = x1, r__2 = r__1;
  406.     x3 = r__2 * (r__1 * r__1);
  407.     s_wsfe(&io___56);
  408.     do_fio(&c__1, (char *)&x1, (ftnlen)sizeof(real));
  409.     do_fio(&c__1, (char *)&x2, (ftnlen)sizeof(real));
  410.     do_fio(&c__1, (char *)&x3, (ftnlen)sizeof(real));
  411.     r__1 = x1 / 2;
  412.     do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
  413.     r__2 = x2 / 2;
  414.     do_fio(&c__1, (char *)&r__2, (ftnlen)sizeof(real));
  415.     r__3 = x3 / 2;
  416.     do_fio(&c__1, (char *)&r__3, (ftnlen)sizeof(real));
  417.     e_wsfe();
  418.     }
  419.     return 0;
  420. } /* flt_test__ */
  421.  
  422. /**************************************************************************/
  423.  
  424. /*     Subroutine to do the algebraic function tests */
  425.  
  426. /**************************************************************************/
  427. /* Subroutine */ int alg_test__(integer *m)
  428. {
  429.     /* Format strings */
  430.     static char fmt_305[] = "(10x,\002x\002,7x,\002SQRT(x)\002,4x,\002CURT"
  431.         "(x)\002,3x,\002SQRT(x)^2\002,2x,\002CURT(x)^3\002)";
  432.     static char fmt_301[] = "(5x,6(f9.6,2x))";
  433.  
  434.     /* System generated locals */
  435.     integer i__1;
  436.     real r__1, r__2, r__3, r__4, r__5;
  437.     doublereal d__1;
  438.  
  439.     /* Builtin functions */
  440.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  441.         e_wsle(void), s_wsfe(cilist *), e_wsfe(void);
  442.     double sqrt(doublereal), pow_dd(doublereal *, doublereal *);
  443.     integer do_fio(integer *, char *, ftnlen);
  444.  
  445.     /* Local variables */
  446.     static integer i;
  447.     static real x1, x2, x3;
  448.  
  449.     /* Fortran I/O blocks */
  450.     static cilist io___57 = { 0, 6, 0, 0, 0 };
  451.     static cilist io___58 = { 0, 6, 0, fmt_305, 0 };
  452.     static cilist io___63 = { 0, 6, 0, fmt_301, 0 };
  453.  
  454.  
  455.     s_wsle(&io___57);
  456.     do_lio(&c__9, &c__1, "\nGenerate a table of floats, square & cube roots,"
  457.         " and their squares & cubes.\n", 77L);
  458.     e_wsle();
  459.     s_wsfe(&io___58);
  460.     e_wsfe();
  461.     i__1 = *m;
  462.     for (i = 1; i <= i__1; ++i) {
  463.     x1 = i * 1.f;
  464.     x2 = sqrt(x1);
  465.     d__1 = (doublereal) x1;
  466.     x3 = pow_dd(&d__1, &c_b152);
  467.     s_wsfe(&io___63);
  468.     do_fio(&c__1, (char *)&x1, (ftnlen)sizeof(real));
  469.     do_fio(&c__1, (char *)&x2, (ftnlen)sizeof(real));
  470.     do_fio(&c__1, (char *)&x3, (ftnlen)sizeof(real));
  471. /* Computing 2nd power */
  472.     r__2 = x2;
  473.     r__1 = r__2 * r__2;
  474.     do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real));
  475. /* Computing 3rd power */
  476.     r__4 = x3, r__5 = r__4;
  477.     r__3 = r__5 * (r__4 * r__4);
  478.     do_fio(&c__1, (char *)&r__3, (ftnlen)sizeof(real));
  479.     e_wsfe();
  480.     }
  481.     return 0;
  482. } /* alg_test__ */
  483.  
  484. /**************************************************************************/
  485.  
  486. /*     Subroutine to do the transcendental function tests */
  487.  
  488. /**************************************************************************/
  489. /* Subroutine */ int trn_test__(void)
  490. {
  491.     /* Format strings */
  492.     static char fmt_207[] = "(9x,\002x\002,9x,\002sin(x)\002,8x,\002cos(x"
  493.         ")\002,4x,\002sin(x)^2 + cos(x)^2\002)";
  494.     static char fmt_200[] = "(5x,i2,\002*pi/6\0023x,f11.8,3x,f11.8,3x,f15.10)"
  495.         ;
  496.     static char fmt_299[] = "(a1)";
  497.     static char fmt_208[] = "(11x,\002x\002,16x,\002log(x)\002,9x,\002exp(lo"
  498.         "g(x))\002)";
  499.     static char fmt_201[] = "(5x,f13.10,5x,f13.10,5x,f13.10)";
  500.  
  501.     /* System generated locals */
  502.     doublereal d__1;
  503.  
  504.     /* Builtin functions */
  505.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  506.         e_wsle(void), s_wsfe(cilist *), e_wsfe(void);
  507.     double sin(doublereal), cos(doublereal);
  508.     integer do_fio(integer *, char *, ftnlen), s_rsfe(cilist *), e_rsfe(void);
  509.     double log(doublereal), exp(doublereal);
  510.  
  511.     /* Local variables */
  512.     static char junk[2];
  513.     static doublereal c;
  514.     static integer i;
  515.     static doublereal s, x, c2, s2, pi;
  516.  
  517.     /* Fortran I/O blocks */
  518.     static cilist io___65 = { 0, 6, 0, 0, 0 };
  519.     static cilist io___66 = { 0, 6, 0, 0, 0 };
  520.     static cilist io___67 = { 0, 6, 0, fmt_207, 0 };
  521.     static cilist io___74 = { 0, 6, 0, fmt_200, 0 };
  522.     static cilist io___75 = { 0, 6, 0, 0, 0 };
  523.     static cilist io___76 = { 0, 5, 0, fmt_299, 0 };
  524.     static cilist io___78 = { 0, 6, 0, 0, 0 };
  525.     static cilist io___79 = { 0, 6, 0, fmt_208, 0 };
  526.     static cilist io___80 = { 0, 6, 0, fmt_201, 0 };
  527.  
  528.  
  529.     pi = 3.141592653589793f;
  530.     s_wsle(&io___65);
  531.     do_lio(&c__9, &c__1, "\nPart 1: Trig Functions", 23L);
  532.     e_wsle();
  533.     s_wsle(&io___66);
  534.     do_lio(&c__9, &c__1, "\nGenerate a table of x, sin(x), cos(x) and the su"
  535.         "m of their squares.\n", 69L);
  536.     e_wsle();
  537.     s_wsfe(&io___67);
  538.     e_wsfe();
  539.     for (i = 0; i <= 12; ++i) {
  540.     x = i * pi / 6.f;
  541.     s = sin(x);
  542.     c = cos(x);
  543. /* Computing 2nd power */
  544.     d__1 = s;
  545.     s2 = d__1 * d__1;
  546. /* Computing 2nd power */
  547.     d__1 = c;
  548.     c2 = d__1 * d__1;
  549.     s_wsfe(&io___74);
  550.     do_fio(&c__1, (char *)&i, (ftnlen)sizeof(integer));
  551.     do_fio(&c__1, (char *)&s, (ftnlen)sizeof(doublereal));
  552.     do_fio(&c__1, (char *)&c, (ftnlen)sizeof(doublereal));
  553.     d__1 = s2 + c2;
  554.     do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal));
  555.     e_wsfe();
  556.     }
  557.     s_wsle(&io___75);
  558.     do_lio(&c__9, &c__1, "\nPart 2:  Exponential functions; hit return to co"
  559.         "ntinue...", 58L);
  560.     e_wsle();
  561.     s_rsfe(&io___76);
  562.     do_fio(&c__1, junk, 2L);
  563.     e_rsfe();
  564.     s_wsle(&io___78);
  565.     do_lio(&c__9, &c__1, "Generate a table of x, log(x), and exp(log(x))\n", 
  566.         47L);
  567.     e_wsle();
  568.     s_wsfe(&io___79);
  569.     e_wsfe();
  570.     for (i = 1; i <= 10; ++i) {
  571.     x = (doublereal) i;
  572.     s = log(x);
  573.     c = exp(s);
  574.     s_wsfe(&io___80);
  575.     do_fio(&c__1, (char *)&x, (ftnlen)sizeof(doublereal));
  576.     do_fio(&c__1, (char *)&s, (ftnlen)sizeof(doublereal));
  577.     do_fio(&c__1, (char *)&c, (ftnlen)sizeof(doublereal));
  578.     e_wsfe();
  579.     }
  580.     return 0;
  581. } /* trn_test__ */
  582.  
  583. /* Main program alias */ int test_f2c__ () { MAIN__ (); return 0; }
  584.